home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / Plug-in - WireFrame Renderer / SR_Math.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  1.9 KB  |  84 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        SR_Math.h                                                 **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **     Purpose:     Sample renderer math routines                              **
  7.  **                                                                          **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1992-1996 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                          **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14. #ifndef SR_Math_h
  15. #define SR_Math_h
  16.  
  17. #include "QD3D.h"
  18. #include "QD3DGeometry.h"
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif    /* __cplusplus */
  23.  
  24.  
  25. typedef struct TSRVector4D {
  26.     float         x;
  27.     float        y;
  28.     float        z;
  29.     float        w;
  30. } TSRVector4D;
  31.  
  32. TQ3Status SRTriangle_GetNormal(
  33.     TQ3TriangleData        *triangleData,
  34.     TQ3Vector3D            *normal);
  35.     
  36. void SRMatrix_LUDecomposeSingular3x3(
  37.     float                 matrix[3][3],
  38.     long                 indexPtr[3],
  39.     float                 *rowInterchanges,
  40.     long                *rank);
  41.  
  42. TQ3Status SRMatrix_ComputeFlatLand(
  43.     TQ3Matrix4x4        *matrix,
  44.     TQ3Matrix3x3        *luDecomp,
  45.     TQ3Boolean            parallelProjection,
  46.     TSRVector4D            *eyeVectorWC,
  47.     TQ3RationalPoint4D    *eyePointWC,
  48.     TSRVector4D            *eyeVectorLC,
  49.     TQ3PlaneEquation    *flatWorld);
  50.     
  51. TSRVector4D *SRVector4D_Set(
  52.     TSRVector4D            *vector4D,
  53.     float                x, 
  54.     float                y,
  55.     float                z, 
  56.     float                w);
  57.     
  58. TSRVector4D *SRVector3D_To4D(
  59.     const TQ3Vector3D    *vector3D,
  60.     TSRVector4D            *result);
  61.     
  62. TQ3Vector3D *SRVector4D_To3D(
  63.     const TSRVector4D    *vector4D,
  64.     TQ3Vector3D            *result);
  65.     
  66. TSRVector4D *SRVector4D_Negate(
  67.     const TSRVector4D    *vector4D,
  68.     TSRVector4D            *result);
  69.     
  70. TSRVector4D *SRVector4D_Normalize(
  71.     const TSRVector4D    *vector4D,
  72.     TSRVector4D            *result);
  73.     
  74. TSRVector4D *SRVector4D_Transform(
  75.     const TSRVector4D    *vector4D,
  76.     const TQ3Matrix4x4    *matrix4x4,
  77.     TSRVector4D            *result);
  78.  
  79. #ifdef __cplusplus
  80. }
  81. #endif    /* __cplusplus */
  82.  
  83. #endif  /*  SR_Math_h  */
  84.